package com.fourth.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fourth.dao.UbAddrDao;
import com.fourth.service.UbAddrService;
import com.fourth.util.GetUidUtil;
import com.ljx.entity.Addr;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Mr.ma
 * @since 2023/3/6 14:21
 **/
@Service
public class UbAddrServiceImpl implements UbAddrService {

    @Resource
    private UbAddrDao ubAddrDao;

    @Override
    public List<Addr> getUserAddr() {
        String uid = GetUidUtil.getUid();
        QueryWrapper<Addr> wrapper = new QueryWrapper<>();
        wrapper.eq("uid",uid);
        List<Addr> addrs = ubAddrDao.selectList(wrapper);
        return addrs;
    }
}
